// prompt to input name and email...
// https://docs.nodejitsu.com/articles/command-line/how-to-prompt-for-command-line-input

// npm install prompt
var prompt = require('prompt');
var properties = [{
	name: 'username',
	message:'input your name',
	validator: /^[a-zA-Z\s\-]+$/,
	warning: 'Username must be only letters, spaces, or dashes'
}, {
	message:'input password',
	name: 'password',
	hidden: true,
	validator:function(text){console.log('password validator:'+text);return true;}
}];

prompt.start();

prompt.get(properties, function(err, result) {
	if (err) {
		return onErr(err);
	}
	console.log('Command-line input received:');
	console.log('  Username: ' + result.username);
	console.log('  Password: ' + result.password);
});

function onErr(err) {
	console.log(err);
	return 1;
}